import { any } from "../core/logic";
import { Component, ComponentType } from "./Component";
/**
 * @memberof w.component
 */
class Destroy extends Component {
    constructor(opts = {}) {
        opts.type = any(opts.type, ComponentType.Destroy);
        super(opts);
        this.autoUpdate = true
    }
    update() {
        if (!this.autoUpdate || !this.enable) {
            return false;
        }
        this.publish(this.event);
        return true;

    }
}
export { Destroy }